<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>상품 상세</title>
<script type="text/javascript">
	function go_update() {
		document.frm.action = "update.htm";
		document.frm.submit();
	}
	function go_delete() {
		var delok = confirm("정말 삭제하시겠습니까?");
		if (delok) {
			document.frm.action = "delete.htm?prodCode=${p.prodCode}";
			document.frm.submit();
		}
	}
</script>
</head>
<body>
	<table>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<form name="frm" method="post" enctype="multipart/form-data">
					<table width="600" border="1">
						<tr>
							<th>상품코드</th>
							<td><input type="text" name="prodCode" value="${p.prodCode}"></td>
						</tr>
						<tr>
							<th>상품이름</th>
							<td><input type="text" name="prodName" value="${p.prodName}"></td>
						</tr>
						<tr>
							<th>카테고리</th>
							<td><select name="prodCategory">
									<c:set var="category" value="${p.prodCategory}" />
									<c:set var="sel" value="selected=selecetd" />
									<option value="outer" ${category=='outer'?sel:""}>아우터</option>
									<option value="shirt" ${category=='shirt'?sel:""}>셔츠</option>
									<option value="tee" ${category=='tee'?sel:""}>티</option>
									<option value="bottm" ${category=='bottom'?sel:""}>바지</option>
							</select></td>
						</tr>
						<tr>
							<th>제조사</th>

							<td><select name="prodMaker">
									<c:set var="maker" value="${p.prodMaker}" />
									<c:set var="sel" value="selected=selecetd" />
									<option value="abecrombi" ${maker=='abecrombi'?sel:""}>아베크롬비</option>
									<option value="polo" ${maker=='polo'?sel:""}>폴로</option>
									<option value="levise" ${maker=='levise'?sel:""}>리바이스</option>
									<option value="market" ${maker=='market'?sel:""}>시장</option>
							</select></td>
						</tr>
						<tr>
							<th>원산지</th>
							<td><select name="prodCountry">
									<c:set var="country" value="${p.prodCountry}" />
									<c:set var="sel" value="selected=selecetd" />
									<option value="korea" ${country=='korea'?sel:""}>한국</option>
									<option value="tiwan" ${country=='tiwan'?sel:""}>대만</option>
									<option value="usa" ${country=='usa'?sel:""}>미국</option>
									<option value="japan" ${country=='japan'?sel:""}>일본</option>
									<option value="china" ${country=='china'?sel:""}>중국</option>
							</select></td>
						</tr>
						<tr>
							<th>상품설명</th>
							<td><textarea rows="5" cols="50" name="prodDesc">${p.prodDesc}</textarea></td>
						</tr>
						<tr>
							<th>입고가격</th>
							<td><input type="text" name="prodInPrice" value="${p.prodInPrice}"></td>
						</tr>
						<tr>
							<th>판매가격</th>
							<td><input type="text" name="prodOutPrice" value="${p.prodOutPrice}"></td>
						</tr>
						<tr>
							<th>재고</th>
							<td><input type="text" name="prodStock" value="${p.prodStock}"></td>
						</tr>
						<tr>
							<th>등록일</th>
							<td><input type="text" name="prodRegdate" value='<fmt:formatDate value="${p.prodRegdate}" pattern="yyyy/MM/dd"/>' readonly="readonly"></td>
						</tr>
						<tr>
							<th>상세사진</th>
							<td><img src="../images/${p.prodImage}" width="200" height="200"><br> <input type="file" name="file"></td>
						</tr>
						<tr>
							<td><input type="button" value="수정" onclick="go_update()"> <input type="button" value="삭제" onclick="go_delete()"></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</table>
</body>
</html>